calculates linear interpolation between integer numbers with output real.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | x1 | |||
integer, | intent(in) | :: | x2 | |||
real(kind=float), | intent(in) | :: | y1 | |||
real(kind=float), | intent(in) | :: | y2 | |||
integer, | intent(in) | :: | x |
FUNCTION LinearInterpIntFloat & ( x1, x2, y1, y2, x ) & RESULT (y) IMPLICIT NONE ! Function arguments ! Scalar arguments with intent(in): INTEGER, INTENT (IN) :: x1, x2, x REAL (KIND = float), INTENT (IN) :: y1, y2 ! Scalar arguments with intent (out): REAL (KIND = float) :: y !------------end of declaration------------------------------------------------ y = y1 + ( y2 - y1 ) / ( x2 - x1 ) * ( x - x1 ) END FUNCTION LinearInterpIntFloat